home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / Utility / File⁄Disk Utilities / SF&I / About SF&I < prev    next >
Encoding:
Text File  |  1991-06-06  |  10.1 KB  |  124 lines  |  [TEXT/ttxt]

  1.  
  2. About SF&I
  3.  
  4.      SF&I is a SCSI Formatter and Installer.  With SF&I, this document, and Apple's ResEdit, you should be able to prepare a SCSI disk drive for use with your Mac Plus in short order.  Of course, you'll also need technical information about your particular drive.  If your drive obstinately refuses to work with either of the drivers provided, you'll need source code for Apple's sample SCSI driver and some means of assembling it.  The sample driver is part of the Macintosh Software Supplement, Volume 1, Issue 3.  
  5.  
  6.      SF&I is distributed as shareware.  You are encouraged to re-distribute this package, provided only that you distribute the entire package: the program SF&I; the resource file SF&I TMPL's; the resource file Vanilla Resources; and this document.  If you use SF&I successfully, you should do at least one of the following:
  7.  
  8. 1.  Donate blood through your local Red Cross chapter.  Please send me a note telling me you've done so.  I'd like to know that some good has come of my appeal.
  9.  
  10. 2.  If large quantities of blood make you uneasy, send me $10, of which I'll send half to my local Red Cross.  (I already give them my blood from time to time.)  My address is:
  11.  
  12. Ephraim Vishniac
  13. P.O. Box 1357
  14. East Arlington, MA 02174
  15.  
  16. Distribution restrictions: You can't sell SF&I, and you can't distribute it with any commercial product.  (For example, you can't sell disk drives and give away SF&I.)  You can license SF&I for commercial distribution; write for details.
  17.  
  18. To obtain the lastest version of this program (supposing any later exist!), enclose a diskette and a self-addressed, stamped envelope with your contribution.
  19.  
  20.  
  21. Background
  22.  
  23. If you've already read The SCSI Manager (chapter 31 of Inside Macintosh, Volume 4, distributed with the latest installment of the software supplement), you can skip over this section.
  24.  
  25. The Mac Plus ROMs support SCSI devices in two ways.  First, they contain a set of routines for communicating with devices attached through the Mac Plus SCSI port: the SCSI Manager.  Second, the boot code in the ROMs uses the SCSI manager and one standard SCSI command (Read) to bootstrap from SCSI disks.  The ROM does not contain a SCSI device driver.
  26.  
  27. A bootable SCSI disk must contain several special data structures.  The first of these is the Driver Descriptor Map (DDM).  Located in block zero of the drive, the DDM lists and locates all of the SCSI drivers resident on the drive.  Most drives will have only one driver (a Mac Plus driver), but provision is made for use of the same disk with multiple systems requiring different drivers.
  28.  
  29. The second data structure on the drive, located in block one, is the Device Partition Map (DPM).  The DPM lists and locates all of the logical partitions of the drive.  Most drives will only have one partition (a Mac HFS volume), but provision is made for multiple partitions, potentially of different types.
  30.  
  31. The other data structures of interest are the actual device driver, pointed to by the DDM, and the actual Mac volume, pointed to by the DPM.
  32.  
  33. SF&I prepares a SCSI disk for use by formatting the disk and writing each of these data structures in an appropriate place.
  34.  
  35.  
  36. Technical Stuff
  37.  
  38. SF&I is designed to be easily configurable using ResEdit and the collection of TMPL resources (ResEdit resource templates) provided in the file SF&I TMPL's.  These templates allow you to edit three new resource types: 'SCMD' (SCSI command); 'DDM ' (driver descriptor map); and 'DPM ' (device partition map).  To prepare for the following steps, use ResEdit to copy the TMPL resources from SF&I TMPL's to ResEdit itself.  As a precaution, you should set aside backup copies of both ResEdit and SF&I.
  39.  
  40. SF&I uses up to seven user-provided SCSI commands to configure, format, and certify your drive, and to write the DDM, DPM, and driver on the disk.  Each command is stored in the program file as an SCMD resource.  Each SCMD resource consists of the following items:
  41.  
  42. 1.    The command's data transfer length.  This also describes    the direction of data transfer: positive lengths indicate    reads (disk-to-Mac transfers) and negative lengths mark writes (Mac-to-disk transfers).  The actual length of a write is the absolute value of the length given, of course.  Some commands do not involve data transfer; these have a data transfer length of zero.
  43.  
  44. 2.    The data transfer increment size.  This should be one for small transfers (such as sense or set mode commands).  For normal reads and writes, it should be the block size of the device (usually 512).
  45.  
  46. 3.    The resource type and resource number of the data (if any) to be written by this command.
  47.  
  48. 4.    The number of ticks (sixtieths of a second) allowed for command completion.
  49.  
  50. 5.    The actual SCSI command, given as a list of hexadecimal bytes.  Although most SCSI commands are six bytes, commands of all lengths are allowed.
  51.  
  52. As mentioned above, you can supply up to seven commands.  As indicated in the following list, some commands are required.  If an optional command is not supplied, that step is skipped when SF&I runs.  Each SCMD resource is identified by name, as follows:
  53.  
  54.      'Sense'            The Request Sense command for the drive.  This is
  55.      [Required]       used both for retrieving error information and for 
  56.                                      clearing Unit Attention status.  (I'm told that Request
  57.                                      Sense clears Unit Attention.  Since my drive doesn't
  58.                                      go into Unit Attention following reset, I haven't
  59.                                      checked this out.)
  60.  
  61.      'Mode'            The Mode Select command for the drive.  This can be
  62.      [Optional]       used to set drive parameters before formatting.
  63.  
  64.      'Format'         The Format Unit command for the drive.  While the
  65.      [Optional]       format command is "standard," formatting options        differ.
  66.  
  67.      'Certify'          The Certify command for the drive.  Some vendors
  68.      [Optional]       supply a command for testing the reliability of
  69.                                     each sector and mapping out failing sectors or tracks.
  70.  
  71.      'DDM'            A write command for writing the Driver Descriptor
  72.      [Required]     Map on the drive.
  73.  
  74.      'DPM'            A write command for writing the Device Partition
  75.      [Required]     Map on the drive.  The data resource for this command
  76.                                    is used when opening the driver during installation.
  77.  
  78.      'Driver'         A write command for writing the device driver on
  79.      [Required]     the drive.  The data resource for this command is 
  80.                                    assumed to be the SCSI driver for the drive; it's
  81.                                    installed in memory and opened during disk installation.
  82.  
  83. As delivered, SF&I is set up to format and install a Rodime 652 disk drive.  This twenty-megabyte drive comes with acceptable factory defaults, so no Mode Select command is needed.  The Format Unit command is set to use only the factory-supplied permanent defect list (PLIST), discarding the growing defect list (GLIST).  This is a safe practice since the Format Unit is followed by a Certify operation, which tests every sector and adds defective ones to a fresh GLIST.  The RO652 provides an extended sense block of eighteen bytes.
  84.  
  85. To tweak SF&I for your disk, you'll need to refer to your drive's technical documentation.  You may need a Mode Select Command.  You'll probably need to modify the Format Unit command and remove or change the Certify command.  You'll almost certainly have to change the Request Sense command, since the amount of sense data varies among controllers.  Most importantly, you'll have to adjust the drive and partition sizes given in the DDM and DPM.  These sizes are in 512-byte sectors.  The partition size should be the drive size minus eight reserved sectors: one each for the DDM and DPM, and six for the driver.
  86.  
  87. The SCSI driver included with SF&I as SDRV resource 128 is Apple's sample SCSI driver with several small changes.  The range checking was fixed so that the last sector of the disk is accessible.  Code was added to the installation routine to cut back the size of the memory block held by the driver at boot time.  And, specifically for the RO652, the driver was changed to always do "blind" reads, since the RO652 can't seem to boot if normal reads are used.
  88.  
  89. In an attempt to make use of other drives easier, I've included a set of "plain vanilla" installation SCMD's and another version of the sample SCSI driver in the file Vanilla Resources.  The only difference between the two drivers is that the vanilla driver does normal reads at boot time.  If neither of these two drivers works with your drive, you'll have to obtain a copy of driver source code from the latest Software Supplement and modify it for your drive.  Besides ordering it from Apple, you can also download this material from Delphi and Compuserve.  I haven't included the source code in this package, because it's copyright by Apple.
  90.  
  91.  
  92. Bugs
  93.  
  94. I don't know of any.  Let me know if you meet some.
  95.  
  96.  
  97. Questions?
  98.  
  99. If you have questions or problems, I might be able to help you.  Then again, I might not, because my experience with SCSI devices isn't very extensive.  In any case, you can contact me by (in order of preference and cheapness):
  100.  
  101.     sending uucp mail to decvax!wanginst!wang!ephraim;
  102.  
  103.     sending U.S. mail to P.O. Box 1357, East Arlington, MA 02174; or
  104.  
  105.     sending MCI mail to "MassTech."
  106.  
  107. Despite the mailbox name, please understand that MassTech Development Labs is defunct.  Questions concerning MassTech products or business should be directed to Steve Roux, former owner.  To get in touch with him, write to MassTech's former address or call information in Groton, MA.
  108.  
  109.  
  110. The Future
  111.  
  112. If SF&I shows promise in the field, I'll work on an enhanced version.  Probable future features include:
  113.  
  114. Support for SF&I resource documents, so that you won't have to use ResEdit on SF&I directly and user groups can build a library of SF&I documents for various drives.
  115.  
  116. Some kind of support for scripts, so that you aren't stuck with the present fixed sequence of commands.
  117.  
  118. The ability to use data read by commands.  For example,    support for "Read Capacity" so that you don't have to set the    exact disk and partition sizes in the DDM and DPM by hand.
  119.  
  120. Source code for the driver, if I can get Apple's permission.
  121.  
  122. Coherent documentation.
  123.  
  124. Whatever else you suggest...